<%-- 
    Document   : VerContest
    Created on : 31/03/2011, 08:52:37 PM
    Author     : Jhon
--%>

<%@page import="vo.VOContest"%>
<%@page import="java.util.List"%>
<%@page import="vo.VOUser"%>
<%@page import="vo.VOUser"%>
<%@page import="control.Controller"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="HTML.*"%>
<%@include file="CheckSession.jsp"%>
<% HtmlBody b = new HtmlBody("Contest - Contest List","");
   HtmlContent c = new HtmlContent("Contests");
   VOUser a = (VOUser) session.getAttribute("USER");
   if(a.isIsAdmin()){
   b.addUsuario(a.getHandle(), "Administrator");
   c.addStoryContest();
   }else{
   b.addUsuario(a.getHandle(), "User");
   
   }
   HtmlSideBar s = new HtmlSideBar(true);
   
   c.addSearchC("Search Contest", "Contest/SearchContest.jsp");

   String[] datos ={"Code", "Name", "Start Date" , "End Date"};
   c.addInitLista("Contest","600", datos);
   Controller con = Controller.getInstance();
    List<VOContest> list = con.listContests();
    if(list!=null && !list.isEmpty())
   for(VOContest p:list){
    datos[0]=String.valueOf(p.getContestCode());
    datos[1]=p.getName();
    datos[2]=String.valueOf(p.getStart().toString());
    datos[3]=String.valueOf(p.getEnd().toString());
    c.addDataLista(datos);
   }
   c.addEndLista();
   b.addContent(c.getContent());
   b.addSideBar(s.getBar());
    %>


    <%=b.getHtml()%>
